package cn.uai.activiti8.initializer;


import cn.uai.activiti8.approval.plugins.DelegateProcessV2Plugin;
import cn.uai.activiti8.cache.GlobalCache;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

/**
 * @desc 插件初始化器
 * @author uai
 * @since 2025/7/30 15:17
 * @version 1.0
 */
@Configuration
public class PluginInitializer implements CommandLineRunner {

    @Override
    public void run(String... args) {

//        ProductManagePlugin productManagePlugin = new ProductManagePlugin();
//        WeightApprovalPlugin weightApprovalPlugin = new WeightApprovalPlugin();
//        DelegateProcessPlugin delegateProcessPlugin = new DelegateProcessPlugin();
        DelegateProcessV2Plugin delegateProcessV2Plugin = new DelegateProcessV2Plugin();
//        ProductManageParallelPlugin productManageParallelPlugin = new ProductManageParallelPlugin();
//
//        GlobalCache.PLUGINS.put(productManagePlugin.plugin(), productManagePlugin.clazz());
//        GlobalCache.PLUGINS.put(weightApprovalPlugin.plugin(), weightApprovalPlugin.clazz());
//        GlobalCache.PLUGINS.put(delegateProcessPlugin.plugin(), delegateProcessPlugin.clazz());
        GlobalCache.PLUGINS.put(delegateProcessV2Plugin.plugin(), delegateProcessV2Plugin.clazz());
//        GlobalCache.PLUGINS.put(productManageParallelPlugin.plugin(), productManageParallelPlugin.clazz());

    }
}
